    <div class="headingBox">
        <div class="FloatLeft"><img alt="" src="<?php echo imageUrl(); ?>red_leftRound.jpg" height="24" width="5"></div>
        <div style="width:992px;" class="red_midRound"><?php echo $page_heading; ?></div>
        <div class="FloatLeft"><img alt="" src="<?php echo imageUrl(); ?>red_rightRound.jpg" height="24" width="5"></div>
    </div>
        <div>
        <?php 
			$name = (isset($name) && $name != '' ) ? trim($name) : '';
		?>
        <form id="agent_assign_form" method="post" action="<?php echo base_url().$this->uri->segment(1); ?>/save<?php echo ($name != '' ) ? "/$name" : ''; ?>">
            <input name="sbmt" id="sbmt" value="1" type="hidden">
            <table class="subContentTable" cellpadding="2" cellspacing="5" width="100%">
                <tbody>
                <tr>
                    <td width="20%"><strong>Skill Name<span class="required">*</span>:</strong></td>
                    <td width="35%">
                        <input name="name" id="name" <?php if( $name != '') echo "readonly='readonly'"; ?> value="<?php echo set_value('name', isset($name) ? $name : '' ); ?>" size="30" type="text">
                        <?php echo form_error('name', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                    <td width="20%"><strong>Description<span class="required">*</span>:</strong></td>
                    <td width="35%">
                        <input name="description" value="<?php echo set_value('description', isset($description) ? $description : '' ); ?>" size="30" type="text">
                        <?php echo form_error('description', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                </tr>
                <tr>
                    <td width="20%"><strong>MOH Class<span class="required">*</span>:</strong></td>
                    <td width="35%">
                        <input name="musiconhold" id="musiconhold" value="<?php echo set_value('musiconhold', isset($musiconhold) ? $musiconhold : '' ); ?>" size="30" type="text">
                        <?php echo form_error('musiconhold', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                    <td width="20%"><strong>Context<span class="required">*</span>:</strong></td>
                    <td width="35%">
                        <input name="context" value="<?php echo set_value('context', isset($context) ? $context : '' ); ?>" size="30" type="text">
                        <?php echo form_error('context', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                </tr>
                
                <tr>
                    <td width="20%"><strong>Timeout<span class="required">*</span>:</strong></td>
                    <td width="35%">
                        <input name="timeout" id="timeout" value="<?php echo set_value('timeout', isset($timeout) ? $timeout : '' ); ?>" size="30" type="text">
                        <?php echo form_error('timeout', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                    <td width="20%"><strong>Warm-up Time<span class="required">*</span>:</strong></td>
                    <td width="35%">
                        <input name="wrapuptime" value="<?php echo set_value('wrapuptime', isset($wrapuptime) ? $wrapuptime : '' ); ?>" size="30" type="text">
                        <?php echo form_error('wrapuptime', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                </tr>
                
                 <tr>
                    <td width="20%"><strong>Call Routing Strategy<span class="required">*</span>:</strong></td>
                    <td width="35%"><?php 
					   $strategies = getCallRoutingStrategies();
					   $strategy = set_value('strategy', isset($strategy) ? $strategy : '' );
	                   echo create_select("strategy", $strategies, $strategy );
					   echo form_error('strategy', '<div class="errorMsg_1" style="">', '</div>'); ?>
                      
                    </td>
                    <td width="20%"><strong>Advance Routing<span class="required">*</span>:</strong></td>
                    <td width="35%">
                        <?php 
						  $advance_routing = array('yes' => 'Yes', 'no' => 'No');
						  $advancerouting = set_value('advancerouting', isset($advancerouting) ? $advancerouting : '' );
						  echo create_select("advancerouting", $advance_routing, $advancerouting );
						  echo form_error('advancerouting', '<div class="errorMsg_1" style="">', '</div>'); 
                        ?>
                    </td>
                </tr>
                
                <tr>
                    <td width="20%"><strong>Retry:</strong></td>
                    <td width="35%">
                        <input name="retry" id="retry" value="<?php echo set_value('retry', isset($retry) ? $retry : '' ); ?>" size="30" type="text">
                        <?php echo form_error('retry', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                    <td width="20%"><strong>Service Level:</strong></td>
                    <td width="35%">
                        <input name="servicelevel" value="<?php echo set_value('servicelevel', isset($servicelevel) ? $servicelevel : '' ); ?>" size="30" type="text">
                        <?php echo form_error('servicelevel', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                </tr>
                 
                <tr>
                    <td width="20%"><strong>Server<span class="required">*</span>:</strong></td>
                    <td width="35%">
                       <?php
					   $acd_servers = get_all_acd_servers();
					   $server = set_value('server', isset($server) ? $server : '' );
	                   echo create_select("server", $acd_servers, $server, array('value'=>'server_ip', 'label'=>'server_ip') );
					   echo form_error('server', '<div class="errorMsg_1" style="">', '</div>'); ?>
                    </td>
                    <td width="20%"></td>
                    <td width="35%"></td>
                </tr>
				
         		
                
                <tr>
                    <td colspan="4" align="center">
                    <div style="border:0px solid; width:70%" align="center">
                    
                    	 <div class="selectable" style="float:left; border:0px solid; width:auto; padding:2px">
                          <span style="display:block; text-align:left; padding:2px 0px; font-size:14; font-weight:bold"> Select Agents </span>
                         <select multiple="multiple" id="all_agents"  style="height:275px; width:300px">
                             <?php 
								foreach($agents as $row) 
								{
									if( in_array($row->agent, $skill_member_arr) )
									{
										continue;	
									}
									?>
									<option value='<?php echo $row->agent; ?>'><?php echo $row->agent_name. "(".$row->agent.")"; ?></option>	
							<?php
								}
								?>
                         </select>
                         </div>
                         <div class="selectable" style="float:left; border:0px solid; width:auto; margin-top:150px">
                            <input id="add" type="button" value=">" style="width:27px;"> <br />
                            <input id="add_all" type="button" value=">>"  style="width:27px;"> <br />
                            <input id="remove" type="button"  style="width:27px;" value="<"> <br />
                            <input id="remove_all" type="button"  style="width:27px;" value="<<">
                         </div>
                         
                         <div class="selected"  style="float:left; border:0px solid; width:auto; padding:2px">
                         <span style="display:block; text-align:left; padding:2px 0px; font-size:14; font-weight:bold"> Selected Agents </span>
                         <select multiple="multiple" id="agents" name="agents[]" style="height:275px; width:300px">
                             <?php 
								foreach($agents as $row) 
								{
									if( ! in_array($row->agent, $skill_member_arr) )
									{
										continue;	
									}
									?>
									<option value='<?php echo $row->agent; ?>'><?php echo $row->agent_name. "(".$row->agent.")"; ?></option>	
							<?php
								}
								?>
                         </select>
                         </div>
                         <div style="clear:both"></div>
                         
                         </div>
                    	<?php /*<div  class="multi_sel_div" >
                         <select multiple="multiple" id="agents" name="agents[]">
                             <?php 
								foreach($agents as $row) 
								{
									$selected = '';
									if( count($skill_member_arr) > 0 ) 
									{
										if( in_array($row->agent, $skill_member_arr) )
										{
											$selected =  'selected="selected"';
										}
									}
									?>
									<option <?php echo $selected; ?> value='<?php echo $row->agent; ?>'><?php echo $row->agent_name. "(".$row->agent.")"; ?></option>	
							<?php
								}
								?>
                         </select>
                        	</div>*/ ?>
                            </td>
                      </tr>
                
                
                

                <tr bgcolor="#fff1d5">
                    <td colspan="4" align="left">
                        <input value="" class="backBtn" onclick="location.href='<?php echo base_url().$this->uri->segment(1); ?>';" type="button">
                      <input value="" class="submitBtn" id="btn_submit" type="button">
                    </td>
                </tr>
            </tbody></table>
        </form> 
    </div>
<script>
 
 

 
 
     $().ready(function() {  
	 
	 
	  $('#all_agents').dblclick(function() 
	 {  
	 	  $('#all_agents option:selected').remove().appendTo('#agents');  deSelect();
     });
	 
	 $('#agents').dblclick(function() 
	 {  
	 	  $('#agents option:selected').remove().appendTo('#all_agents');  deSelect();
     });
	 
	 
	 $('#add_all').click(function() 
	 {  
	 
		 $('#all_agents option').each(function(i) {  
     		 $(this).remove().appendTo('#agents')
     	});  

	  deSelect();
	  return false;
     });  
	 
	 
	 $('#remove_all').click(function() 
	 {  
		 $('#agents option').each(function(i) {  
     	 $(this).remove().appendTo('#all_agents')
     	});  
	  deSelect();
	  return false;
     });  
	 
	 
     $('#add').click(function() 
	 {  
 	  $('#all_agents option:selected').remove().appendTo('#agents');  
	  deSelect();
	  return false;
      });  
	  
	  
     $('#remove').click(function() {  
	  $('#agents option:selected').remove().appendTo('#all_agents');  
	 deSelect();
	  return false;
	  
     });  
    });  
	
  $('#btn_submit').click(function() 
  {  
	$('#agents option').each(function(i) {  
	 $(this).attr("selected", "selected");  
	});  
	 
	$('#agent_assign_form').submit();
	
    });  
	
	function deSelect()
	{
		$('#agents option').each(function(i) {  
     	 $(this).removeAttr("selected")
     	});
		
		$('#all_agents option').each(function(i) {  
     	 $(this).removeAttr("selected")
     	});	
	}
 
	/*$('#agents').multiSelect({
			selectableHeader : '<h4>Available Agents</h4>',
			selectionHeader : '<h4>Assigned Agents</h4>'
		});
		*/
</script>  